package com.ruoyi.business.rule.domain;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.ruoyi.business.base.JoBaseEntity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

/**
 * 业务规则历史对象 jb_rules_history
 *
 * @author ruoyi
 * @date 2024-10-11
 */
@TableName(autoResultMap = true)
@Data
public class JbRulesHistory extends JoBaseEntity
{
    private static final long serialVersionUID = 1L;

    /**
     * 业务规则id
     */
    @Excel(name = "业务规则id")
    private Long rulesId;

    /**
     * 业务规则类型编码
     */
    @Excel(name = "业务规则类型编码")
    private String rulesTypeCode;

    /**
     * 规则内容
     */
    @Excel(name = "规则内容")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private JSONObject rulesContent;

    /**
     * 状态（0正常 1停用）
     */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private Long status;

    public JbRulesHistory()
    {
    }

    public JbRulesHistory(JbRules jbRules)
    {
        this.rulesId = jbRules.getId();
        this.rulesContent = jbRules.getExecutionContent();
        this.rulesTypeCode = jbRules.getRulesCode();
        this.status = jbRules.getStatus();
    }
}
